package com.brainhealth.customer.service.impl;

import java.util.List;
import com.brainhealth.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.brainhealth.customer.mapper.CustomerReportTimeMapper;
import com.brainhealth.customer.domain.CustomerReportTime;
import com.brainhealth.customer.service.ICustomerReportTimeService;

/**
 * 会员每次训练报告Service业务层处理
 * 
 * @author wolong
 * @date 2023-05-18
 */
@Service
public class CustomerReportTimeServiceImpl implements ICustomerReportTimeService 
{
    @Autowired
    private CustomerReportTimeMapper customerReportTimeMapper;

    /**
     * 查询会员每次训练报告
     * 
     * @param customerReportTimeId 会员每次训练报告主键
     * @return 会员每次训练报告
     */
    @Override
    public CustomerReportTime selectCustomerReportTimeByCustomerReportTimeId(Long customerReportTimeId)
    {
        return customerReportTimeMapper.selectCustomerReportTimeByCustomerReportTimeId(customerReportTimeId);
    }

    /**
     * 查询会员每次训练报告列表
     * 
     * @param customerReportTime 会员每次训练报告
     * @return 会员每次训练报告
     */
    @Override
    public List<CustomerReportTime> selectCustomerReportTimeList(CustomerReportTime customerReportTime)
    {
        return customerReportTimeMapper.selectCustomerReportTimeList(customerReportTime);
    }

    /**
     * 新增会员每次训练报告
     * 
     * @param customerReportTime 会员每次训练报告
     * @return 结果
     */
    @Override
    public int insertCustomerReportTime(CustomerReportTime customerReportTime)
    {
        customerReportTime.setCreateTime(DateUtils.getNowDate());
        return customerReportTimeMapper.insertCustomerReportTime(customerReportTime);
    }

    /**
     * 修改会员每次训练报告
     * 
     * @param customerReportTime 会员每次训练报告
     * @return 结果
     */
    @Override
    public int updateCustomerReportTime(CustomerReportTime customerReportTime)
    {
        customerReportTime.setUpdateTime(DateUtils.getNowDate());
        return customerReportTimeMapper.updateCustomerReportTime(customerReportTime);
    }

    /**
     * 批量删除会员每次训练报告
     * 
     * @param customerReportTimeIds 需要删除的会员每次训练报告主键
     * @return 结果
     */
    @Override
    public int deleteCustomerReportTimeByCustomerReportTimeIds(Long[] customerReportTimeIds)
    {
        return customerReportTimeMapper.deleteCustomerReportTimeByCustomerReportTimeIds(customerReportTimeIds);
    }

    /**
     * 删除会员每次训练报告信息
     * 
     * @param customerReportTimeId 会员每次训练报告主键
     * @return 结果
     */
    @Override
    public int deleteCustomerReportTimeByCustomerReportTimeId(Long customerReportTimeId)
    {
        return customerReportTimeMapper.deleteCustomerReportTimeByCustomerReportTimeId(customerReportTimeId);
    }
}
